package top.infopub.mgr.cap.dao;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.infopub.model.cap.FinancialElectSublist;
import top.infopub.model.cap.FinancialInstitutions;
import top.infopub.model.cap.FinancialInstitutionsDetail;
import top.infopub.model.cap.SetupFinancial;

import java.util.List;

/**
 * @Author Warking
 * @Date 2021/5/23 21:37
 * @Version 1.0  金融机构
 */
@Repository
public interface FinancialInstitutionsDao {
    /*金融机构列表接口*/
    Page<FinancialInstitutions> selectPage(FinancialInstitutions financialInstitutions);
    /*根据ID查询金融机构选择表数据*/
    FinancialInstitutions findById(@Param("id") String id);
    /*根据子表的金融ID查询页面详情的数据*/
    FinancialInstitutionsDetail selectById(@Param("id")String JinRoId,@Param("proCode")String proCode);
    /*根据主表ID查询子表数据*/
    List<FinancialElectSublist> selectSublistById(@Param("id")String financialInstitutionsId);
    /*根据ID查询主表数据*/
    FinancialInstitutions selectByKey(@Param("id")String id);
    /*根据id修改主表*/
    void updateById( FinancialInstitutions financialInstitutions);
    //修改子表数据  这个参数ID是金融机构的SGUID 是详情sql查询的
    void updateBySublist(FinancialInstitutionsDetail financialInstitutionsDetail);
    /*根据proCode 判断主表有没有数据*/
    FinancialInstitutions findByProCode(@Param("proCode")String proCode);
    //保存主表数据
    void saveFinancialInstitutions(FinancialInstitutions financialInstitutions);
    //保存子表数据
    void saveFinancialElectSublist(FinancialElectSublist financialElectSublist);
    //根据子表的金融ID 查询详情数据
    SetupFinancial selectByIdSetupFinancial(@Param("id")String setupFinancialId);
}
